//
// Created by yewei on 2023/1/9.
//
#include <bits/stdc++.h>

using namespace std;

int main() {
    freopen("../input.txt", "r", stdin);
    int T;
    cin>>T;
    int n;
    while(T--){
        cin>>n;
        vector<int> v(n+1);
        int cnt = 0;
        for(int i=1;i<=n;i++) {
            cin>>v[i];
            if(v[i]) cnt++;
        }
        if(cnt<3) {
            cout<<"NO"<<endl;
            continue;
        }
    }
}
